//
//  PictorialDetailViewController.m
//  Pictorial
//
//  Created by SKY on 15/12/29.
//  Copyright © 2015年 sky. All rights reserved.
//

#import "PictorialDetailViewController.h"

#import "PictorialArticleModel.h"

#import "PictorialDetailView.h"

#import "UMSocial.h"

@interface PictorialDetailViewController ()<PictorialDetailViewDelegate>

@end

@implementation PictorialDetailViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    PictorialDetailView *pictorialDetailView = [PictorialDetailView classInitializtion];
    [self.view addSubview:pictorialDetailView];
    pictorialDetailView.delegate = self;
    pictorialDetailView.model = self.model;
    
}
-(void)shareWithContent:(NSString *)content picture:(NSString *)picture platform:(NSInteger)type{
    
    NSArray *array = @[UMShareToSina,UMShareToQQ,UMShareToQzone,UMShareToWechatSession,UMShareToWechatTimeline,UMShareToWechatFavorite];
    
    UIImage *image = [UIImage imageWithData:[NSData dataWithContentsOfURL:[NSURL URLWithString:picture]]];
    [[UMSocialDataService defaultDataService]  postSNSWithTypes:@[array[type]] content:content image:image location:nil urlResource:nil presentedController:self completion:^(UMSocialResponseEntity *shareResponse){
        if (shareResponse.responseCode == UMSResponseCodeSuccess) {
            DEBUGLog(@"分享成功！");
        }
    }];
}
-(void)back{
    [self dismissViewControllerAnimated:YES completion:nil];
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
}

@end
